package com.scu.qingshi.infrastructure.dao.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;


import com.scu.qingshi.config.cummunity.CommunityFactory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 青时
 * @since 2022-03-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Node对象", description="")
@NoArgsConstructor
@Builder
@AllArgsConstructor
public class Node implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "node_id", type = IdType.AUTO)
    private Integer nodeId;

    @ApiModelProperty(value = "通知方式： 邮箱 短信")
    private String informWay;

    private Integer interId;

    private Date createTime;

    private Date modifyTime;

    @ApiModelProperty(value = "面试地点")
    private String interPlace;

    @ApiModelProperty(value = "0为线下 1为线上")
    private Integer online;

    @ApiModelProperty(value = "开始时间,开始时间要在报名截止之后")
    private Date startTime;

    @ApiModelProperty(value = "结束时间")
    private Date endTime;

    @ApiModelProperty(value = "此轮简介")
    private String interContent;

    @ApiModelProperty(value = "通知失败的模版")
    private String informFail;

    @ApiModelProperty(value = "通知通过模版")
    private String informPass;

    public String onlineVO(){
        return online == 0 ? "线下面试" : "线上面试";
    }

    public String emailTemplate(){
        StringBuilder template = new StringBuilder();

        template.append("您好\n")
                .append("下一场面试将于").append(startTime).append("-").append(endTime).append("之间进行\n")
                .append("面试为").append(online==0?"线下面试\n":"线上面试\n")
                .append("面试地点为：").append(interPlace).append("\n")
                .append("面试内容概括：").append(interContent);

        return template.toString();
    }

}
